#!/bin/bash

# 设置后端镜像名称和标签
BACKEND_IMAGE_NAME="registry.cn-beijing.aliyuncs.com/yuchengg/pdocs"
TAG="latest"

# 构建后端项目
echo "Building backend..."
npm install
npm run docs:build

# 构建后端 Docker 镜像
echo "Building backend Docker image..."
docker build -t $BACKEND_IMAGE_NAME:$TAG .

# 推送镜像到 Docker Registry（如果需要）
echo "Pushing backend image to Docker Registry..."
docker push $BACKEND_IMAGE_NAME:$TAG

echo "Backend build and deployment completed!" 